package com.disgnpattern.learn.chapter2;

/**
 * @author dxy
 * @version 1.0
 * @date 2021/10/21 14:50
 * @decripton
 */
public class CashRebate implements CashSuper {
    private double defaultRebate = 1.0d;

    public CashRebate(double defaultRebate) {
        this.defaultRebate = defaultRebate;
    }

    @Override
    public double acceptCash(double totalPrice) {
        return totalPrice * defaultRebate;
    }
}
